Multi Segment Progess Bar
Visually communicate the progress of a specific process and its sub-processes.
#Multi-segment progress bar vs. Progress bar
Component | Purpose | Usage guideline | Examples |
---|---|---|---|
Multi-Segment Progress Bar | Shows progress through distinct steps/phases. | Helps users understand where they are in a process and what comes next. | Multi-step forms, wizards, complex flows. |
Progress Bar | Shows overall progress of a single process. | Indicates how much of a task is complete. | File uploads, loading content. |
#Examples
A visual component that displays progress towards multiple goals or targets within a single container. It utilizes stacked segments to represent each goal's progress and overall completion status.
Composition:
- Container: The overall bounding box of the component.
- Segments: Individual bars or sections representing each goal or target.
- Label (recommended): Text elements that describe the segments.
- Values (recommended): Numerical or percentage indicators of progress for each segment.
#Basic usage
This showcases the progress bar in its most common form, with filled segments indicating completed steps and an empty segment representing the step currently in progress.
<MultiSegmentProgressBar
size={"medium"}
total={240}
segments={[
{ value: 15, color: ColorGreen, tooltip: "15 out of 240" },
{ value: 10, color: ColorBlue, tooltip: "10 out of 240" },
{ value: 25, color: ColorRed, tooltip: "25 out of 240" },
{ value: 35, color: ColorYellow, tooltip: "35 out of 240" },
{ value: 70, color: ColorPink, tooltip: "70 out of 240" },
{ value: 5, color: ColorPurple, tooltip: "5 out of 240" },
{ value: 0, color: ColorBlack, tooltip: "0 out of 240" }, // this one is not rendered, because value: 0
]}
/>
#Empty
This illustrates the progress bar's initial state, where no steps have been completed yet. All segments are in the "empty" or "inactive" state.
<MultiSegmentProgressBar size={"medium"} total={240} segments={[]} />
#Sizes
This demonstrates the flexibility of the multi-segment progress bar, showing how it can adapt to different heights and widths to fit within various layouts and design requirements.
Small
Medium
Large
<div>
<div style={{ marginTop: "0.625rem" }}>
<H4>Small</H4>
<MultiSegmentProgressBar
size={"small"}
total={500}
segments={[
{ value: 300, color: ColorBlue, tooltip: "300 out of 500" },
{ value: 35, color: ColorYellow, tooltip: "35 out of 500" },
]}
/>
</div>
<div style={{ marginTop: "0.625rem" }}>
<H4>Medium</H4>
<MultiSegmentProgressBar
size={"medium"}
total={900}
segments={[
{ value: 300, color: ColorBlue, tooltip: "300 out of 900" },
{ value: 35, color: ColorYellow, tooltip: "35 out of 900" },
]}
/>
</div>
<div style={{ marginTop: "0.625rem" }}>
<H4>Large</H4>
<MultiSegmentProgressBar
size={"large"}
total={700}
segments={[
{ value: 300, color: ColorBlue, tooltip: "300 out of 700" },
{ value: 35, color: ColorYellow, tooltip: "35 out of 700" },
]}
/>
</div>
</div>
#Custom segment styles
This highlights the ability to customize the appearance of individual segments. Here, you can see different colors, patterns, or textures applied to segments, allowing for greater visual differentiation and customization.
<MultiSegmentProgressBar
size={"large"}
total={100}
segments={[
{ value: 10, color: ColorGreen, tooltip: "10 out of 100" },
{
value: 80,
color: ColorGreenLighter,
tooltip: "80 out of 100",
style: {
border: `dashed ${ColorGreen}`,
borderWidth: "2px 2px 2px 0",
},
/* or use
className: "someClassName"
*/
},
]}
/>
Property | Description | Defined | Value |
---|---|---|---|
totalRequired | number The maximum total value of all segments. This determines the scale of the progress bar. | ||
segmentsRequired | object[] | ||
sizeOptional | "large" | "medium" | "small" | ||
disableInitialAnimationOptional | boolean If true, there is no animation on first render. If values change after first render, there is an animation. | ||
data-observe-keyOptional | string Unique string, used by external script e.g. for event tracking | ||
classNameOptional | string Custom className that's applied to the outermost element (only intended for special cases) | ||
styleOptional | object Style object to apply custom inline styles (only intended for special cases) |
#Guidelines
#Best practices
#Do not use when
#Accessibility
Explore detailed guidelines for this component: Accessibility Specifications